import {service1} from "./custReq";

function getProducts(url,data) {
  return service1.post(url,data);
}
function addProduct(url,data){
  return service1({
    url,
    method:'post',
    data
  })
}
//分页查询
function getCheckoutCate(url,data) {
  return service1.post("/porcelain"+url,data)
}
//删除瓷器信息
function getDeleteData(url) {
  return service1.delete("/porcelain"+url)
}
//修改瓷器信息
function getChangePorcelainInfo(url,data) {
  return service1.put('/porcelain'+url,data)
}
//上传文件实现
function  upLoad(url,file,params) {
  let formData = new FormData();
  formData.append("file", file.file);
  return service1.post('/porcelain'+url,formData,{
    headers:{  "Content-Type":
        "multipart/form-data;boundary=" + new Date().getTime()},
    params
  })
}
export {getProducts,addProduct,getCheckoutCate,getDeleteData,getChangePorcelainInfo,upLoad}